package com.study.designpatterns.singleton;

/**
 * @author: jzhou
 * @date: 2025/6/15-12:11
 * @version: 1.0
 * @description: 懒汉式 ：由于加了锁，对性能影响较大，不推荐使用。
 */
public class SingletonLazy {
    private static SingletonLazy instance;
    private SingletonLazy(){}

    public static synchronized SingletonLazy getInstance(){
        if(instance == null){
            instance = new SingletonLazy();
        }
        return instance;
    }
}
